package fileoperator;

import java.util.regex.Pattern;

public class PathFilter {
	
	private static final Pattern PATTERN_EXCLAMATION_MARK = Pattern.compile("^[a-zA-Z0-9.-_ ]{0,555}$");
	
	public static void main(String[] args) {
		String path = "D:/javasoft/workspace/fengkongfile/doc/2017-4-2/L/2017-4-2-QuarterReportMode.doc";
		path = "..\\";
		path.split(".");
		System.out.println(path.contains("../"));
		System.out.println(path.contains("..\\"));
		
	}
	
	
	public static String path(String path) {
		return path(path,0);
	}
	
	public static String path(String path,int num) {
		
		if(num==0) {
			if(path.contains("../")) {
				return path.replace("../","");
			}
		}else {
			int i = path.lastIndexOf("../");
			System.out.println(i);
			path = path.substring(0, i);
			i = path.lastIndexOf("../");
			System.out.println(i);
			path = path.substring(0, i);
			i = path.lastIndexOf("../");
			System.out.println(i);
		}
		return "";
	}
	
}
